var roofApp = "http://testgwtaliti.appspot.com";
var imagePath = "";
var a=document.getElementById("jjjavascript");
var maindivsize =a.getAttribute("paramwidth");

////////////////////////////////////StyleSheet/////////////////////////////////////
var link = document.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = roofApp + "/css/jcomment.css"; 
document.head.appendChild(link);

link = document.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = roofApp + "/css/fb-buttons.css"; 
document.head.appendChild(link);

////////////////////////////////////SCRIPTS////////////////////////////////////////

var script = document.createElement('script');
script.src = "https://apis.google.com/js/client.js";
script.type="text/javascript";
document.head.appendChild(script);
	
/*var script = document.createElement('script');
script.src = roofApp +"/js/jquery-2.1.0-beta2.min.js";
script.type="text/javascript";
document.head.appendChild(script);

script = document.createElement('script');
script.src = roofApp +"/js/jquery-migrate-1.2.1.min.js";
script.type="text/javascript";
document.head.appendChild(script);
*/

script = document.createElement('script');
script.src = roofApp + "/js/jcomment.js";
script.type="text/javascript";
document.head.appendChild(script);

script = document.createElement('script');
script.src =roofApp + "/js/gapimethods.js";
script.type="text/javascript";
document.head.appendChild(script);

script = document.createElement('script');
script.src = roofApp + "/js/initclient.js";
script.type="text/javascript";
document.head.appendChild(script);


var returnHTML = "";	

/////////////////////////////////////////////////////////// table of controllers
returnHTML+= '<div style="display:none;position:absolute;bottom:100px;right:100px;border:1px dashed #000000;padding:20px">';
returnHTML+= '<table>';
returnHTML+= '<tr><td>merchantId</td><td><input type="text" id="jcMerchantId" value="1" style="width: 300px" /></td></tr>';
returnHTML+= '<tr><td>ownerUserId</td><td><input type="text" id="jcOwnerId" value="1" style="width: 300px" /></td></tr>';
returnHTML+= '<tr><td>FBid</td><td><input type="text" value="0" id="jcfbid" style="width: 300px" /></td></tr>';
returnHTML+= '<tr><td>firstName</td><td><input type="text" value="0" id="jcFirstName" style="width: 300px" /></td></tr>';
returnHTML+= '<tr><td>lastName</td><td><input type="text" value="0" id="jcLastName" style="width: 300px" /></td></tr>';
returnHTML+= '<tr><td>emailAddress</td><td><input type="text" value="0" id="jcEmailAddress" style="width: 300px" /></td></tr>';
returnHTML+= '<tr><td>userName</td><td><input type="text" value="0" id="jcUserName" style="width: 300px" /></td></tr>';
returnHTML+= '<tr><td>imageurl</td><td><input type="text" value="" id="jcImageUrl" style="width: 300px" /></td></tr>';
returnHTML+= '<tr><td>pageurl</td><td><input type="text" value="" id="jcPageUrl" style="width: 300px" /> </td></tr>';
returnHTML+= '<tr><td>boardId</td><td><input type="text" id="jcBoardId" value="0" style="width: 300px" /></td></tr>';
returnHTML+= '<tr><td>userId</td><td><input type="text" value="0" id="jcUserId" style="width: 300px" /></td></tr>';
returnHTML+= '<tr><td>country</td><td><input type="text" value="0" id="jcCountry" style="width: 300px" /></td></tr>';
returnHTML+= '<tr><td>city</td><td><input type="text" value="0" id="jcCity" style="width: 300px" /></td></tr>';
returnHTML+= '<tr><td>ip</td><td><input type="text" value="0" id="jcIPAddress" style="width: 300px" /></td></tr>';
returnHTML+= '</table>';
returnHTML+= '</div>';
///////////////////////////////////////////////////////////

returnHTML+= '<div id="maindiv" style="width:'+ maindivsize +'">';
returnHTML+= '<div>';
returnHTML+= '<div class="composerHeader"><a id="jcOpenComment"  class="uibutton confirm" >Have a question?</a>';
returnHTML+= '<div class="fb-login-button" scope="email,user_checkins" onlogin="loggedin();"  data-size="medium" id="jcFbLoginDiv" style="display:none;" >Login to ask a question</div>';
returnHTML+= '</div></div>';
returnHTML+= '<div class="composer" style="display:none;">';
returnHTML+= '<table border="0" cellpadding="1" cellspacing="2" width="100%">';
returnHTML+= '<tr>';
returnHTML+= '<td rowspan="2" valign="top" style="width:60px"><img class="imageMeRef" alt="" src="" width="55px" height="65px"></td>';
returnHTML+= '<td colspan="3" valign="top">';
returnHTML+= '<div class="innerWrap">';
returnHTML+= '<textarea class="uiTextareaAutogrow "  name="text_text" id="textAreaComment" >Ask your question...</textarea>';
returnHTML+= '</div></td>';
returnHTML+= '<td></td>';
returnHTML+= '</tr>';
returnHTML+= '<tr>';
returnHTML+= '<td><div style="width:60px;white-space: nowrap;"><input id="jcAskOfAgent" type="checkbox"/>Ask Of Agent.</div></td>';
returnHTML+= '<td></td>';
returnHTML+= '<td align="right"><div ><input type="button" class="uibutton confirm" value="Comment" id="jcAddComment"></a></div></td>';
returnHTML+= '<td></td>';
returnHTML+= '</tr>';
returnHTML+= '<tr>';
returnHTML+= '<td></td>';
returnHTML+= '<td></td>';
returnHTML+= '<td></td>';
returnHTML+= '<td></td>';
returnHTML+= '<td></td>';
returnHTML+= '</tr>';
returnHTML+= '</table>';
returnHTML+= '</div>';
returnHTML+= '<div id="jcFadedDiv" class="uiBoxLightblue" style="display:none;">';
returnHTML+= '<div style="height: 25px;width: 350px"></div>';
returnHTML+= '</div>';
returnHTML+= '<br/>';
returnHTML+= '<div id="boardCommentList" style="display:none;">';
returnHTML+= '</div>';
returnHTML+= '</div>';
returnHTML+= '</div>';

document.getElementById("jcplace").innerHTML = returnHTML;